package cn.smart.core.util;


import cn.smart.core.model.UserSession;

public class UserContext {
    static  ThreadLocal<UserSession> threadLocal = new ThreadLocal<>();
    //往当前线程脑门上贴一个变量UserSession
    public static void set(UserSession user){
        threadLocal.set(user);
    }
    //从当前线程脑门上获取UserSession
    public static UserSession get(){
        return threadLocal.get();
    }
    // 移除当前线程脑门上的UserSession
    public static void remove(){
        threadLocal.remove();
    }
}
